package com.forum.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 评论表(Comment)实体类
 *
 * @author makejava
 * @since 2024-04-12 20:33:58
 */
@Data
@ApiModel(value = "评论表", description = "评论表")
@AllArgsConstructor
@NoArgsConstructor
public class Comment implements Serializable {
    private static final long serialVersionUID = 228850502057843460L;
    @ApiModelProperty("评论ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("父节点")
    private Integer parentId;

    @ApiModelProperty("文章id")
    private Integer articleId;

    @ApiModelProperty("用户ID")
    private Integer uid;

    @ApiModelProperty("地址")
    private String address;

    @ApiModelProperty("评论内容")
    private String content;

//    @ApiModelProperty("点赞数")
//    private Integer likes;

    @ApiModelProperty("图片")
    private String contentImg;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @ApiModelProperty("用户")
    @TableField(exist = false)
    private User user;


}

